/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package NetworkRequests;

import Common.Whois;
import Forms.QueryResultForm;
import Main.Program;

/**
 *
 * @author Hmong
 */
public class WhoisSocketRequest extends WhoisRequest {

    private String _WhoisServer;
    private int _Port;

    public WhoisSocketRequest(String domain, String whoisServer){
        this(domain, whoisServer, 43);
    }

    public WhoisSocketRequest(String domain, String whoisServer, int port){
        super(domain);
        
        _WhoisServer = whoisServer;
        _Port = port;
    }

    public String GetWhoisServer(){
        return _WhoisServer;
    }

    public int GetPort(){
        return _Port;
    }

    public void run() {
        String queryResult = Whois.GetDomainInfo(GetDomain(), GetWhoisServer(), GetPort());
        QueryResultForm form = new QueryResultForm(queryResult);
        Program.GetDisplay().setCurrent(form);
    }

}
